<!-- 下订单 -->
<template>
	<view class="main-all">
		<view class="form">
		    <view class="form__cell">
		        <view class="form__label">订单编号:</view>
		        <view class="form__note">{{data.code}}</view>
		    </view>
		    <view class="form__cell">
		        <view class="form__label">订单分类:</view>
		        <view class="form__note">{{data.typename}}</view>
		    </view>
		    <view class="form__cell">
		        <view class="form__label">具体名称:</view>
		        <view class="form__note">{{data.proname}}</view>
		    </view>
		    <view class="form__cell">
		        <view class="form__label">甲方名称:</view>
		        <view class="form__note">{{data.jfuname}}</view>
		    </view>
		    <view class="form__cell">
		        <view class="form__label">甲方电话:</view>
		        <view class="form__note">{{data.jfsjh}}</view>
		    </view>
			<view class="form__cell">
			    <view class="form__label">乙方名称:</view>
			    <view class="form__note">{{data.yfuname}}</view>
			</view>
			<view class="form__cell">
		        <view class="form__label">乙方电话:</view>
		        <view class="form__note">{{data.yfsjh}}</view>
		    </view>
			
			<view class="form__cell">
			    <view class="form__label">订单单价:</view>
			    <view class="form__note">{{data.dddj}}</view>
			</view>
			<view class="form__cell">
			    <view class="form__label">订单总价:</view>
			    <view class="form__note">{{data.allprice}}</view>
			</view>
			<view class="form__cell">
			    <view class="form__label">航线:</view>
			    <view class="form__note">{{data.qd}}-{{data.zd}}</view>
			</view>
			<view class="form__cell">
			    <view class="form__label">文件合同:</view>
			    <view class="form__note seeFile" @click="gopage(data.jfht,'jfht')">点击查看甲方合同文件</view>
			</view>
			<view class="form__cell">
			    <view class="form__label">文件合同:</view>
			    <view class="form__note seeFile" @click="gopage(data.yfht,'yfht')">点击查看乙方合同文件</view>
			</view>
			<view class="form__cell">
				<textarea class="form-text" v-model="data.bzxx" placeholder="请输入信息内容" auto-height />
			</view>
		</view>
	</view>
</template>
<script>
	import { secondorders} from '@/service/getData.js';
	import { router, toast } from '@/common/util.js';
	import { mapState, mapActions, mapMutations } from 'vuex';
	export default{
		components: {
			
		},
		onLoad(options){
			this.id = options.id;
			console.log(options.id);
			var that = this;
			uni.getStorage({
				key:'ordertype',
				complete: function (res) {
					that.ordertype = res.data;
					that.getorder();
				}
			})
			
		},
		data() {
			return {
				id:'',
				data: '',
				ordertype: '',
				
			}
		},
		computed: mapState(['userInfo', 'hasLogin']),
		methods:{
			getorder(){
				var uid;
				if(this.ordertype == 1){
					uid = "22431";
				}else{
					uid = "121";
				}
				let sent = {
					"type":"hyorderlist",
					"orderid":this.id,
					// "uid":this.userInfo.uid,
					"uid": uid,
					"stauts":'',
					"key":"",
					"sf":this.ordertype,
					"ordertype":this.ordertype,
					"orderid":this.id,
					"page":"1",
					"size":"10",
				}
				console.log(sent);
				toast.loading();
				secondorders({data:sent}).then(res => {
					toast.hideLoading();
					console.log(res.data);
					var getdata = eval('('+res.data+')');
					this.data = getdata[0].meslist[0];
				})
			},
			gopage(ht,type){
				uni.setStorage({
					key:'htfiles',
					data:ht,
					success:function(){
						router.navigateTo('/pages/order/seefile/seefile?type='+type);
					}
				})
			}
		}
		
	}
</script>

<style lang="scss">
	@import '@/style/page/form.scss';
	.main-all{
		margin: 0;
		padding: 0;
		width: 100%;
		background-color: #ffffff;
		.form-text{
			width: 100%;
			border-bottom: 1upx solid #f3f3f3;
			border-radius: 5upx;
			padding: 20upx;
			font-size: 30upx;
		}	
		.seeFile{
			margin-right: 30upx;
			border-bottom: 1upx solid #00a0fd;
			border-radius: 10upx;
			padding: 12upx 30upx;
			font-size: 30upx;
			color: #ffffff;
			background-color: #00a0fd;
		}
	}
</style>
